﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using System.Data;

namespace Waker.WebService
{
    /// <summary>
    /// Service1 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    public class Service : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }
        #region 获取基础数据
        [WebMethod]
        public string GetAllDeption()
        {
            DataTable dt = new BAL.BAL_Cards().GetAllDepartment();
            if (dt == null || dt.Rows.Count < 1)
                return string.Empty;
            //for (int i = dt.Columns.Count - 1; i >= 0; i--)
            //{

            //}
            return JsonHelper.DataTable2Json(dt);
        }
        #endregion


        #region 三级安全教育报表
        [WebMethod]
        public string GetThreeSafeEduRecord(string deptId)
        {
            var dt = new BAL.BAL_Report().GetThreeSafeEduRecord(deptId);
            if (dt == null || dt.Rows.Count < 1)
                return string.Empty;
            return JsonHelper.DataTable2Json(dt);
        }
        #endregion
    }
}